package com.hotel.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 购物车
 * </p>
 *
 * @author Lin
 * @since 2022-06-09
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("shopping_cart")
public class ShoppingCart {

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 菜品id
     */
    @TableField("dish_id")
    private Long dishId;

    /**
     * 口味
     */
    @TableField("dish_flavor")
    private String dishFlavor;

    /**
     * 数量
     */
    @TableField("number")
    private Integer number;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh",timezone ="GMT+8")
    private Date createTime;

    /**
     * 是否选中（0未选中1选中）
     */
    @TableField("checked")
    private Integer checked;

    /**
     * 用户名
     */
    @TableField(exist = false)
    private String nickName;

    /**
     * 名字
     */
    @TableField(exist = false)
    private String name;

    /**
     * 价格
     */
    @TableField(exist = false)
    private String price;

    /**
     * 图像
     */
    @TableField(exist = false)
    private String image;




}
